<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<head>
	<title>BOM详细信息</title>
</head>

<body>

	<form action="#" method="post">
	<c:if test="${!empty visitor &&visitor.adminGrade <=1}">
		<button type="button" class="askAgain"
			onClick="buttonAction(this,'b!delete.z')">
			删除
		</button>
		<button type="button" onClick="buttonAction(this,'bup!toUpdate.z?id=${display['bom'].id}')">
			修改
		</button>
	</c:if>
		<button type="button" onClick="buttonAction(this, 'b!all.z');">
			返回列表
		</button>
	</form>

	<table class="list">
		<thead>

			<tr title="">
				<th>
					BOM编号
				</th>
				<th>
					版本号
				</th>
				<th>
					创建日期
				</th>
				<th>
					备注
				</th>
				<th>
					原始文件
				</th>
			</tr>
		</thead>

		<tr>
			<td>
				${display['bom'].code }
			</td>
			<td>
				VER. ${display['bom'].version }
			</td>
			<td>
				${display['bom'].upload.createTime }
			</td>
			<td>
				${display['bom'].remark }
			</td>
			<td>
				<a href="up!download.z?id=${display['bom'].upload.id}">原始文件</a>
			</td>
		</tr>
	</table>



	<c:if test="${!empty display['emptyCodeBM']}">
		<table class="list">
			<caption class="redAndBold">
				告警：含有空编码的物料
			</caption>
			<thead>
				<tr title="">

					<th>
						物料编号
					</th>
					<th>
						元件编号
					</th>
					<th>
						规格描述
					</th>
					<th>
						PCB封装
					</th>
					<th>
						值
					</th>
					<th>
						电压
					</th>
					<th>
						数量
					</th>
					<th>
						材料选择
					</th>
					<th>
						所属BOM
					</th>
				</tr>
			</thead>
			<c:forEach var="bomMaterial" items="${display['emptyCodeBM']}">
				<tr>
					<td>
						${bomMaterial.code }
					</td>
					<td>
						${bomMaterial.designator }
					</td>
					<td>
						${bomMaterial.comment }
					</td>
					<td>
						${bomMaterial.footprint }
					</td>
					<td>
						${bomMaterial.value }
					</td>
					<td>
						${bomMaterial.voltage }
					</td>
					<td>
						${bomMaterial.quantity }
					</td>
					<td>
						${bomMaterial.stuffOpt }
					</td>
					<td>
						${bomMaterial.bom.code } VER. ${bomMaterial.bom.version }
					</td>

				</tr>
			</c:forEach>
		</table>
	</c:if>

	<c:if test="${!empty display['nullMaterialBM']}">
		<table class="list">
			<caption class="redAndBold">
				告警：含有没有对应的物料
			</caption>
			<thead>
				<tr title="">

					<th>
						物料编号
					</th>
					<th>
						元件编号
					</th>
					<th>
						规格描述
					</th>
					<th>
						PCB封装
					</th>
					<th>
						值
					</th>
					<th>
						电压
					</th>
					<th>
						数量
					</th>
					<th>
						材料选择
					</th>
					<th>
						所属BOM
					</th>
				</tr>
			</thead>
			<c:forEach var="bomMaterial" items="${display['nullMaterialBM']}">
				<tr>
					<td>
						${bomMaterial.code }
					</td>
					<td>
						${bomMaterial.designator }
					</td>
					<td>
						${bomMaterial.comment }
					</td>
					<td>
						${bomMaterial.footprint }
					</td>
					<td>
						${bomMaterial.value }
					</td>
					<td>
						${bomMaterial.voltage }
					</td>
					<td>
						${bomMaterial.quantity }
					</td>
					<td>
						${bomMaterial.stuffOpt }
					</td>
					<td>
						${bomMaterial.bom.code } VER. ${bomMaterial.bom.version }
					</td>

				</tr>
			</c:forEach>
		</table>
	</c:if>

	<c:if test="${!empty display['notPublishBM']}">
		<table class="list">
			<caption class="redAndBold">
				告警：含有未发布的物料
			</caption>
			<thead>
				<tr title="">

					<th>
						物料编号
					</th>
					<th>
						元件编号
					</th>
					<th>
						规格描述
					</th>
					<th>
						PCB封装
					</th>
					<th>
						值
					</th>
					<th>
						电压
					</th>
					<th>
						数量
					</th>
					<th>
						材料选择
					</th>
					<th>
						所属BOM
					</th>
				</tr>
			</thead>
			<c:forEach var="bomMaterial" items="${display['notPublishBM']}">
				<tr>
					<td>
						<a href="m!display.z?id=${bomMaterial.material.id}">${bomMaterial.code
							}</a>
					</td>
					<td>
						${bomMaterial.designator }
					</td>
					<td>
						${bomMaterial.comment }
					</td>
					<td>
						${bomMaterial.footprint }
					</td>
					<td>
						${bomMaterial.value }
					</td>
					<td>
						${bomMaterial.voltage }
					</td>
					<td>
						${bomMaterial.quantity }
					</td>
					<td>
						${bomMaterial.stuffOpt }
					</td>
					<td>
						${bomMaterial.bom.code } VER. ${bomMaterial.bom.version }
					</td>

				</tr>
			</c:forEach>
		</table>
	</c:if>

	<c:if test="${!empty display['notSuggestBM']}">
		<table class="list">
			<caption class="redAndBold">
				告警：含有不推荐的物料
			</caption>
			<thead>
				<tr title="">

					<th>
						物料编号
					</th>
					<th>
						元件编号
					</th>
					<th>
						规格描述
					</th>
					<th>
						PCB封装
					</th>
					<th>
						值
					</th>
					<th>
						电压
					</th>
					<th>
						数量
					</th>
					<th>
						材料选择
					</th>
					<th>
						所属BOM
					</th>
				</tr>
			</thead>
			<c:forEach var="bomMaterial" items="${display['notSuggestBM']}">
				<tr>
					<td>
						<a href="m!display.z?id=${bomMaterial.material.id}">${bomMaterial.code
							}</a>
					</td>
					<td>
						${bomMaterial.designator }
					</td>
					<td>
						${bomMaterial.comment }
					</td>
					<td>
						${bomMaterial.footprint }
					</td>
					<td>
						${bomMaterial.value }
					</td>
					<td>
						${bomMaterial.voltage }
					</td>
					<td>
						${bomMaterial.quantity }
					</td>
					<td>
						${bomMaterial.stuffOpt }
					</td>
					<td>
						${bomMaterial.bom.code } VER. ${bomMaterial.bom.version }
					</td>

				</tr>
			</c:forEach>
		</table>
	</c:if>

	<c:if test="${!empty display['stopUseBM']}">
		<table class="list">
			<caption class="redAndBold">
				告警：含有停用的物料
			</caption>
			<thead>
				<tr title="">

					<th>
						物料编号
					</th>
					<th>
						元件编号
					</th>
					<th>
						规格描述
					</th>
					<th>
						PCB封装
					</th>
					<th>
						值
					</th>
					<th>
						电压
					</th>
					<th>
						数量
					</th>
					<th>
						材料选择
					</th>
					<th>
						所属BOM
					</th>
				</tr>
			</thead>
			<c:forEach var="bomMaterial" items="${display['stopUseBM']}">
				<tr>
					<td>
						<a href="m!display.z?id=${bomMaterial.material.id}">${bomMaterial.code
							}</a>
					</td>
					<td>
						${bomMaterial.designator }
					</td>
					<td>
						${bomMaterial.comment }
					</td>
					<td>
						${bomMaterial.footprint }
					</td>
					<td>
						${bomMaterial.value }
					</td>
					<td>
						${bomMaterial.voltage }
					</td>
					<td>
						${bomMaterial.quantity }
					</td>
					<td>
						${bomMaterial.stuffOpt }
					</td>
					<td>
						${bomMaterial.bom.code } VER. ${bomMaterial.bom.version }
					</td>

				</tr>
			</c:forEach>
		</table>
	</c:if>

	<c:if test="${!empty display['disagreeBM']}">
		<table class="list">
			<caption class="redAndBold">
				告警：含有PCB封装不一致的物料
			</caption>
			<thead>
				<tr title="">

					<th>
						物料编号
					</th>
					<th>
						元件编号
					</th>
					<th>
						规格描述
					</th>
					<th>
						PCB封装
					</th>
					<th>
						值
					</th>
					<th>
						电压
					</th>
					<th>
						数量
					</th>
					<th>
						材料选择
					</th>
					<th>
						所属BOM
					</th>
				</tr>
			</thead>
			<c:forEach var="bomMaterial" items="${display['disagreeBM']}">
				<tr>
					<td>
						<a href="m!display.z?id=${bomMaterial.material.id}">${bomMaterial.code
							}</a>
					</td>
					<td>
						${bomMaterial.designator }
					</td>
					<td>
						${bomMaterial.comment }
					</td>
					<td>
						${bomMaterial.footprint }
					</td>
					<td>
						${bomMaterial.value }
					</td>
					<td>
						${bomMaterial.voltage }
					</td>
					<td>
						${bomMaterial.quantity }
					</td>
					<td>
						${bomMaterial.stuffOpt }
					</td>
					<td>
						${bomMaterial.bom.code } VER. ${bomMaterial.bom.version }
					</td>

				</tr>
			</c:forEach>
		</table>
	</c:if>
	
	
	<table class="list">
		<caption>
			BOM合格的物料表
		</caption>
		<thead>
			<tr title="">

				<th>
					物料编号
				</th>
				<th>
					元件编号
				</th>
				<th>
					规格描述
				</th>
				<th>
					PCB封装
				</th>
				<th>
					值
				</th>
				<th>
					电压
				</th>
				<th>
					数量
				</th>
				<th>
					材料选择
				</th>
				<th>
					所属BOM
				</th>
			</tr>
		</thead>
		<c:forEach var="bomMaterial" items="${display['goodBM']}">
			<tr>
				<td>
					<a href="m!display.z?id=${bomMaterial.material.id}">${bomMaterial.code
						}</a>
				</td>
				<td>
					${bomMaterial.designator }
				</td>
				<td>
					${bomMaterial.comment }
				</td>
				<td>
					${bomMaterial.footprint }
				</td>
				<td>
					${bomMaterial.value }
				</td>
				<td>
					${bomMaterial.voltage }
				</td>
				<td>
					${bomMaterial.quantity }
				</td>
				<td>
					${bomMaterial.stuffOpt }
				</td>
				<td>
					${bomMaterial.bom.code } VER. ${bomMaterial.bom.version }
				</td>

			</tr>
		</c:forEach>
	</table>
</body>